class baseconfig(object):
	CSRF_ENABLED = True
	SECRET_KEY = '123456'
	# mail
	MAIL_SERVER = 'smtp.sina.com'
	MAIL_PROT = 25
	MAIL_USE_TLS = True
	MAIL_USE_SSL = False
	MAIL_USERNAME = "taojun319@sina.com"
	MAIL_PASSWORD = "123.com"
	# MAIL_DEBUG = True
	MAIL_DEFAULT_SENDER = 'taojun319@sina.com'
#
	@staticmethod
	def init_app(app):
		pass


class developconfig(baseconfig):
	DEBUG = True
	# db
	# SQLALCHEMY_DATABASE_URI = 'mysql://flask:123456@192.168.31.185/flask_project'
	# SQLALCHEMY_POOL_TIMEOUT = 10
	# SQLALCHEMY_TRACK_MODIFICATIONS = False
	# SQLALCHEMY_COMMIT_ON_TEARDOWN = True
	import os
	# basedir= os.path.abspath(os.path.dirname(__file__))
	# SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir,'data.sqlit')

	basedir = os.path.abspath(os.path.dirname(__file__))

	SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db')
	SQLALCHEMY_TRACK_MODIFICATIONS = True
	SQLALCHEMY_COMMIT_ON_TEARDOWN=True


class portal(baseconfig):
	# db
	SQLALCHEMY_DATABASE_URI = 'mysql://flask:123456@192.168.31.185/flask_portal'
	SQLALCHEMY_POOL_TIMEOUT = 10
	SQLALCHEMY_TRACK_MODIFICATIONS = False
	SQLALCHEMY_COMMIT_ON_TEARDOWN = True


config = {'default': developconfig, 'portal': portal, 'develop': developconfig}
